package cn.bdqn.service;

import cn.bdqn.domain.Driver;
import cn.bdqn.domain.Routes;
import cn.bdqn.domain.Vehicle;
import cn.bdqn.service.impl.VehicleDriverServiceImpl;
import cn.bdqn.utils.result.Page;
import cn.bdqn.utils.result.Result;
import cn.bdqn.utils.result.ResultGenerator;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 *
 * @author dkj
 */
@Component
@FeignClient(name = "",fallback = VehicleDriverServiceImpl.class)
public interface VehicleDriverService {


    /**
     * 根据id查询
     * @param id
     * @return
     */
    // ------------------- 服务熔断-----------------
    @GetMapping(value = "/driver/queryByPrimaryKey/{id}")
    public Result queryDriverByPrimaryKey(@PathVariable("id") Integer id);

    /**
     * 选择更新信息
     * @param driver
     */
    // ------------------- 服务熔断-----------------
    @RequestMapping(value = "/driver/updateByPrimaryKeySelective/driver")
    public Result updateByPrimaryKeySelective(Driver driver);

    /**
     * 多条件查询   分页
     * @param driver
     * @return
     */
    // ------------------- 服务熔断-----------------
    @GetMapping(value = "/driver/queryByDriver/driver/pageNum/{pageNum}/pageAmount/{pageAmount}")
    public Result queryByDriver(Driver driver,@PathVariable("pageNum") Integer pageNum,@PathVariable("pageAmount") Integer pageAmount);


//    **********************路线****************************


    /**
     * 根据id查询
     * @param id
     * @return
     */
    // ------------------- 服务熔断-----------------
    @GetMapping(value = "/routes/queryByPrimaryKey/{id}")
    public Result queryRoutesByPrimaryKey(@PathVariable("id") Integer id);

    /**
     * 选择更新
     * @param record
     */
    // ------------------- 服务熔断-----------------
    @RequestMapping(value = "/routes/updateByPrimaryKeySelective/record")
    public Result updateByPrimaryKeySelective(Routes record);

    /**
     * 多条件查询   分页
     * @param routes
     * @return
     */
    // ------------------- 服务熔断-----------------
    @GetMapping(value = "/routes/queryByVehicle/Routes/pageNum/{pageNum}/pageAmount/{pageAmount}")
    public Result queryByVehicle(Routes routes,@PathVariable("pageNum") Integer pageNum,@PathVariable("pageAmount") Integer pageAmount);


    //*******************车辆******************

    /**
     * 根据id查询
     * @param id
     * @return
     **/
    // ------------------- 服务熔断-----------------
    @GetMapping(value = "/vehicle/queryByPrimaryKey/{id}")
    public Result queryVehicleByPrimaryKey(@PathVariable("id") Integer id);


    /**
     * 选择更新
     * @param record
     */
    // ------------------- 服务熔断-----------------
    @RequestMapping(value = "/vehicle/updateByPrimaryKeySelective/record")
    public Result updateByPrimaryKeySelective(Vehicle record);

    /**
     * 新增
     * @param record
     */
    // ------------------- 服务熔断-----------------
    @RequestMapping(value = "/vehicle/insert/record")
    public Result insert(Vehicle record);

    /**
     * 多条件查询   分页
     *
     * @param pageNum   当前页
     * @param pageAmount    每页显示的页数
     * @return
     */
    // ------------------- 服务熔断-----------------
    @PostMapping(value = "/vehicle/queryByVehicle/vehicle/pageNum/{pageNum}/pageAmount/{pageAmount}")
    public Result queryByVehicle(Vehicle vehicle,@PathVariable("pageNum") Integer pageNum,@PathVariable("pageAmount") Integer pageAmount);


}
